﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication283
{
    public partial class Form3 : Form
    {
        
        
           
        public Form3()
        {
            InitializeComponent();

            DataTable dt = new DataTable();

            dt.Columns.Add("Price", typeof(double));
            dt.Columns.Add("Quantity", typeof(double));
            dt.Columns.Add("Total Price", typeof(double));
            dt.Rows.Add(3, 5);
            dt.Rows.Add(6, 7);
            dt.Rows.Add(6, 4);
            dt.Rows.Add(6, 9);
            dt.Rows.Add(7, 8);
            ultraGrid1.DataSource = dt.DefaultView;
            ultraGrid1.CalcManager = ultraCalcManager1;
        }

        private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
        {
            e.Layout.Bands[0].Columns["Total Price"].Formula = "[Price]*[Quantity]";
        }
    }
}
